// Thread 类的一些方法
public class ThreadDemo6 {
    public static void main(String[] args) {
        // lambda 表达式
        Thread t = new Thread(() -> {
            System.out.println("hello t");
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        });
        System.out.println("线程名字： " + t.getName());
        System.out.println("线程ID：" + t.getId());
        System.out.println("自己创建的线程默认都是前台线程：" + t.isDaemon());

        System.out.println("t start之前：" + t.isAlive());
        t.start();
        System.out.println("t 在执行：" + t.isAlive());

        try {
            Thread.sleep(1100);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        System.out.println("t 执行结束：" + t.isAlive());
    }
}
